package com.thinkcube.edutainment.service.viewitem;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.thinkcube.edutainment.R;
import com.thinkcube.edutainment.domain.data.LessonData;

/**
 * Shanuka @Cyberlmj 3:08:30 PM Email: shanuka.gayashan@cyberlmj.com
 */
@EViewGroup(R.layout.lesson_item)
public class LessonItem extends RelativeLayout {

	@ViewById(R.id.featured_lesson)
	TextView featured;
	@ViewById(R.id.lesson_title)
	TextView lessonTitle;
	@ViewById(R.id.buy_lesson)
	Button buyLesson;

	public LessonItem(final Context context) {
		super(context);

	}

	public LessonItem(final Context context, final AttributeSet attrs) {
		super(context, attrs);
	}

	public void bind(final LessonData lessonData,boolean isCoursePurchase) {
		lessonTitle.setText(lessonData.getLessonTitle());


		/*System.out.println("LESSON TYPE >>>>"+lessonData.getLessonType());
		
		int type=Integer.valueOf(lessonData.getLessonType());
		
		System.out.println("LESSON TYPE INT >>>>>"+type);
		
		switch (type) {
		case 0:
			
			
				buyLesson.setVisibility(View.INVISIBLE);
			
			break;
			
		case 1:
			
			
			
				if(isCoursePurchase){
					
					buyLesson.setVisibility(View.INVISIBLE);
				}
				
			break;
			
		case 2:
			
				featured.setVisibility(View.VISIBLE);
				System.out.println("this is featured item");
				
				if(lessonData.getIs_lesson_purchased().equals(true)){
					System.out.println("IS LESSON PURCHASE AT LESSONITEM");
					buyLesson.setVisibility(View.INVISIBLE);
				}
			
			
			break;
		}*/

	}


	
	

}
